<template>
  <div>
    <video-card-list :video-list="videoList" :loading="loading"/>
    <van-empty v-if="!videoList || videoList.length<1" description="数据为空"/>
  </div>
</template>

<script setup lang="ts">
import {onMounted, ref, watchEffect} from "vue";
import VideoCardList from "../components/VideoCardList.vue";
import myAxios from "../request/myAxios";

const videoList = ref([]);
const loading = ref<boolean>(false)

onMounted(async () => {
  videoList.value = await myAxios.get('/video/list').then(res=>{
    if (res?.data.code === 0){
      return res.data.data
    }
  })
})
// onMounted(async ()=>{
//   await loadData();
//   console.log(videoList.value)
// })
</script>

<style scoped>

</style>
